<?php
class M_DbTable_Faqs extends Apps_Db_Table_Abstract {
	protected $_name = 'faqs';

	const STATUS_ACTIVE   = 1;
	const STATUS_INACTIVE = 0;

	public function getAllFaqs() {
	    $q = $this->_db
            	    ->select()
            	    ->from('faqs')
            	    ->join('faqs_category', 'faqs_category.id = faqs.faqs_category_id', array('category_title' => 'faqs_category.title'))
            	    ->where('faqs.status = ?', self::STATUS_ACTIVE);

	    return $q;
	}
}